# 使用蓝图
from flask import Blueprint, request, jsonify
from .models import *

blue = Blueprint('user',__name__)


@blue.route('/')
def index():
    return 'index'

# HTTP请求方式
@blue.route('/users/', methods=['GET', 'POST', 'PUT', 'DELETE'])
def users():
    if request.method == 'GET':
        return jsonify({'method': 'GET'})
    elif request.method == 'POST':
        return jsonify({'method': 'POST'})
    elif request.method == 'PUT':
        return jsonify({'method': 'PUT'})
    elif request.method == 'DELETE':
        return jsonify({'method': 'DELETE'})

